<?php
/**
 * CreateTime: 2022/5/9 14:34
 */

namespace App\common;

use App\Consts\ResponseConsts\ResponseStatusConsts;
use App\Func\ResponseFunc;
use App\Models\Client\ClientModel;
use App\Models\Client\CreditClientAppraiseDateModel;
use App\Models\Client\CreditClientModel;
use Illuminate\Http\Exceptions\HttpResponseException;

class cDelayDateF
{

    public function getDefaultClientUpdatePeriodByClientType($clientType){
        $creditClientAppraiseDateModel = new CreditClientAppraiseDateModel();
        return $creditClientAppraiseDateModel->getCreditClientUpdatePeriodByClientType($clientType);
    }

    /**
     * 获取信用客户评审时限
     * @param $clientId
     */
    public function getDefaultClientUpdatePeriodByCreditClientId($clientId){
        # get client type
        $clientModel = new CreditClientModel();
        $credit_client_type = @$clientModel->getCreditClientInfoByClientId($clientId,["credit_client_type"])['credit_client_type'];
        # get credit_client_type
        if(!$credit_client_type){
           return [
               "client_update_period" => 0
           ];
        }
        return $this->getDefaultClientUpdatePeriodByClientType($credit_client_type);
    }
}